<?php if (Yii::app()->user->hasFlash('alertmsg')): ?>
    <?php $msg = Yii::app()->user->getFlash('alertmsg'); ?>
    <?php if ($msg['type'] == 'success'): ?>
    <?php $type = 'success'; ?>
    <?php elseif ($msg['type'] == 'error'): ?>
    <?php $type = 'danger'; ?>
    <?php elseif ($msg['type'] == 'info'): ?>
    <?php $type = 'info'; ?>
    <?php else: ?>
    <?php $type = 'warning'; ?>
    <?php endif; ?>
    <div class="alert alert-<?php echo $type; ?> alert-dismissable" style="margin:10px;">
        <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
        <?php echo $msg['msg']; ?>.
    </div>
<?php endif; ?>
